#pragma compile(inputboxres, true)

#include <MsgBoxConstants.au3>

Local $svnPath = InputBox("SVN 路径", "请输入该固件所在 SVN 目录")

If @error = 0 Then
	Send("#d")
	Run("TortoiseProc.exe /command:repobrowser /path:" & $svnPath)
	WinWaitActive("https://192.168.110.110/svn/cl/clproject/Test")
	MouseClickDrag("PRIMARY", 700, 355, 1240, 355)  ; 将 File 移至末尾
	Sleep(200)  ; 等待窗口刷新
	MouseClickDrag("PRIMARY", 700, 355, 1240, 355)  ; 将 Extension 移至末尾
	Sleep(200)  ; 等待窗口刷新
	MouseClick("PRIMARY", 700, 355)  ; 按 Revision 升序
	Sleep(500)  ; 等待窗口刷新
	MouseClick("PRIMARY", 700, 355)  ; 按 Revision 降序
	MouseClickDrag("PRIMARY", 700, 375, 600, 375)  ; 取最新
	Sleep(2000)  ; 等待窗口出现
	WinWaitClose("正在复制...", "取消")
	Sleep(2000)  ; 等待窗口消失
	WinClose("https://192.168.110.110/svn/cl/clproject/Test")
ElseIf @error = 1 Then
	Run("TortoiseProc.exe /command:repobrowser /path:https://192.168.110.110/svn/cl/clproject/Test")
EndIf